import request from '../utils/request';

// export const fetchData = query => {
//     return request({
//         url: './table.json',
//         method: 'get',
//         params: query
//     });
// };
//获取用户列表数据
export const fetchUser = () => {
    return request({
        url: '/api/userList',
        method: 'get'
    });
};
//添加用户
export const addUser = (data) => {
    return request({
        url:"/api/addUser",
        method:"post",
        data:data
    })
};
//查询用户
export const selUser = (id) =>{
    return request({
        url:"/api/selUser/"+id,
        method:"get"
    })
}
//删除用户
export const delUser = (id) => {
    return request({
        url:"/api/delUser/"+id,
        method:"delete"
    })
}
//编辑用户
export const editUser = (data) => {
    return request({
        url:"/api/editUser",
        method:"put",
        data:data
    })
}